<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>lesson 25</title>
    <style>
        .v-enter-from {
            opacity: 0;
        }

        .v-enter-active {
            transition: opacity 3s ease-in;
        }

        .v-enter-to {
            opacity: 1;
        }
    </style>
    <script src="https://unpkg.com/vue@next"></script>
</head>

<body>
    <div id="root"></div>
</body>

</html>
<script>
    // 多个单元素标签之间的切换
    // 多个单组件之间的切换
    const app = Vue.createApp({
        data() {
            return {
                show: false
            };
        },
        methods: {
            handleClick() {
                this.show = !this.show;
            },
        },
        template: `
        <div>
            <transition>
                <div v-if="show">hello world</div>
                <div v-else="show">bye world</div>
            </transition>
            <button @click="handleClick">切换</button>
        </div>
        `
    });

    const vm = app.mount("#root")
</script>